home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
c
/
AmiVoGL_MDEV.lha
/
examples
/
teapot.c.bak
< prev
next >
Wrap
Text File
|
1997-12-30
|
14KB
|
506 lines
#include <stdio.h>
#ifdef SGI
#include "gl.h"
#include "device.h"
#include "hershey.h"
#else
#include "vogl.h"
#include "vodevice.h"
#endif
/*
* Draws Newell's Teapot as a heap of Bezier surface patches.
*/
#define TEAPOT 1L
/*
* Data for the teapot.
*/
#define NUM_PNTS 306
#define NUM_PATCH 32
float xyz[NUM_PNTS][3] = {
{ 1.400, 0.000, 2.400},
{ 1.400, -0.784, 2.400},
{ 0.784, -1.400, 2.400},
{ 0.000, -1.400, 2.400},
{ 1.337, 0.000, 2.531},
{ 1.337, -0.749, 2.531},
{ 0.749, -1.337, 2.531},
{ 0.000, -1.337, 2.531},
{ 1.438, 0.000, 2.531},
{ 1.438, -0.805, 2.531},
{ 0.805, -1.438, 2.531},
{ 0.000, -1.438, 2.531},
{ 1.500, 0.000, 2.400},
{ 1.500, -0.840, 2.400},
{ 0.840, -1.500, 2.400},
{ 0.000, -1.500, 2.400},
{-0.784, -1.400, 2.400},
{-1.400, -0.784, 2.400},
{-1.400, 0.000, 2.400},
{-0.749, -1.337, 2.531},
{-1.337, -0.749, 2.531},
{-1.337, 0.000, 2.531},
{-0.805, -1.438, 2.531},
{-1.438, -0.805, 2.531},
{-1.438, 0.000, 2.531},
{-0.840, -1.500, 2.400},
{-1.500, -0.840, 2.400},
{-1.500, 0.000, 2.400},
{-1.400, 0.784, 2.400},
{-0.784, 1.400, 2.400},
{ 0.000, 1.400, 2.400},
{-1.337, 0.749, 2.531},
{-0.749, 1.337, 2.531},
{ 0.000, 1.337, 2.531},
{-1.438, 0.805, 2.531},
{-0.805, 1.438, 2.531},
{ 0.000, 1.438, 2.531},
{-1.500, 0.840, 2.400},
{-0.840, 1.500, 2.400},
{ 0.000, 1.500, 2.400},
{ 0.784, 1.400, 2.400},
{ 1.400, 0.784, 2.400},
{ 0.749, 1.337, 2.531},
{ 1.337, 0.749, 2.531},
{ 0.805, 1.438, 2.531},
{ 1.438, 0.805, 2.531},
{ 0.840, 1.500, 2.400},
{ 1.500, 0.840, 2.400},
{ 1.750, 0.000, 1.875},
{ 1.750, -0.980, 1.875},
{ 0.980, -1.750, 1.875},
{ 0.000, -1.750, 1.875},
{ 2.000, 0.000, 1.350},
{ 2.000, -1.120, 1.350},
{ 1.120, -2.000, 1.350},
{ 0.000, -2.000, 1.350},
{ 2.000, 0.000, 0.900},
{ 2.000, -1.120, 0.900},
{ 1.120, -2.000, 0.900},
{ 0.000, -2.000, 0.900},
{-0.980, -1.750, 1.875},
{-1.750, -0.980, 1.875},
{-1.750, 0.000, 1.875},
{-1.120, -2.000, 1.350},
{-2.000, -1.120, 1.350},
{-2.000, 0.000, 1.350},
{-1.120, -2.000, 0.900},
{-2.000, -1.120, 0.900},
{-2.000, 0.000, 0.900},
{-1.750, 0.980, 1.875},
{-0.980, 1.750, 1.875},
{ 0.000, 1.750, 1.875},
{-2.000, 1.120, 1.350},
{-1.120, 2.000, 1.350},
{ 0.000, 2.000, 1.350},
{-2.000, 1.120, 0.900},
{-1.120, 2.000, 0.900},
{ 0.000, 2.000, 0.900},
{ 0.980, 1.750, 1.875},
{ 1.750, 0.980, 1.875},
{ 1.120, 2.000, 1.350},
{ 2.000, 1.120, 1.350},
{ 1.120, 2.000, 0.900},
{ 2.000, 1.120, 0.900},
{ 2.000, 0.000, 0.450},
{ 2.000, -1.120, 0.450},
{ 1.120, -2.000, 0.450},
{ 0.000, -2.000, 0.450},
{ 1.500, 0.000, 0.225},
{ 1.500, -0.840, 0.225},
{ 0.840, -1.500, 0.225},
{ 0.000, -1.500, 0.225},
{ 1.500, 0.000, 0.150},
{ 1.500, -0.840, 0.150},
{ 0.840, -1.500, 0.150},
{ 0.000, -1.500, 0.150},
{-1.120, -2.000, 0.450},
{-2.000, -1.120, 0.450},
{-2.000, 0.000, 0.450},
{-0.840, -1.500, 0.225},
{-1.500, -0.840, 0.225},
{-1.500, 0.000, 0.225},
{-0.840, -1.500, 0.150},
{-1.500, -0.840, 0.150},
{-1.500, 0.000, 0.150},
{-2.000, 1.120, 0.450},
{-1.120, 2.000, 0.450},
{ 0.000, 2.000, 0.450},
{-1.500, 0.840, 0.225},
{-0.840, 1.500, 0.225},
{ 0.000, 1.500, 0.225},
{-1.500, 0.840, 0.150},
{-0.840, 1.500, 0.150},
{ 0.000, 1.500, 0.150},
{ 1.120, 2.000, 0.450},
{ 2.000, 1.120, 0.450},
{ 0.840, 1.500, 0.225},
{ 1.500, 0.840, 0.225},
{ 0.840, 1.500, 0.150},
{ 1.500, 0.840, 0.150},
{-1.600, 0.000, 2.025},
{-1.600, -0.300, 2.025},
{-1.500, -0.300, 2.250},
{-1.500, 0.000, 2.250},
{-2.300, 0.000, 2.025},
{-2.300, -0.300, 2.025},
{-2.500, -0.300, 2.250},
{-2.500, 0.000, 2.250},
{-2.700, 0.000, 2.025},
{-2.700, -0.300, 2.025},
{-3.000, -0.300, 2.250},
{-3.000, 0.000, 2.250},
{-2.700, 0.000, 1.800},
{-2.700, -0.300, 1.800},
{-3.000, -0.300, 1.800},
{-3.000, 0.000, 1.800},
{-1.500, 0.300, 2.250},
{-1.600, 0.300, 2.025},
{-2.500, 0.300, 2.250},
{-2.300, 0.300, 2.025},
{-3.000, 0.300, 2.250},
{-2.700, 0.300, 2.025},
{-3.000, 0.300, 1.800},
{-2.700, 0.300, 1.800},
{-2.700, 0.000, 1.575},
{-2.700, -0.300, 1.575},
{-3.000, -0.300, 1.350},
{-3.000, 0.000, 1.350},
{-2.500, 0.000, 1.125},
{-2.500, -0.300, 1.125},
{-2.650, -0.300, 0.938},
{-2.650, 0.000, 0.938},
{-2.000, -0.300, 0.900},
{-1.900, -0.300, 0.600},
{-1.900, 0.000, 0.600},
{-3.000, 0.300, 1.350},
{-2.700, 0.300, 1.575},
{-2.650, 0.300, 0.938},
{-2.500, 0.300, 1.125},
{-1.900, 0.300, 0.600},
{-2.000, 0.300, 0.900},
{ 1.700, 0.000, 1.425},
{ 1.700, -0.660, 1.425},
{ 1.700, -0.660, 0.600},
{ 1.700, 0.000, 0.600},
{ 2.600, 0.000, 1.425},
{ 2.600, -0.660, 1.425},
{ 3.100, -0.660, 0.825},
{ 3.100, 0.000, 0.825},
{ 2.300, 0.000, 2.100},
{ 2.300, -0.250, 2.100},
{ 2.400, -0.250, 2.025},
{ 2.400, 0.000, 2.025},
{ 2.700, 0.000, 2.400},
{ 2.700, -0.250, 2.400},
{ 3.300, -0.250, 2.400},
{ 3.300, 0.000, 2.400},
{ 1.700, 0.660, 0.600},
{ 1.700, 0.660, 1.425},
{ 3.100, 0.660, 0.825},
{ 2.600, 0.660, 1.425},
{ 2.400, 0.250, 2.025},
{ 2.300, 0.250, 2.100},
{ 3.300, 0.250, 2.400},
{ 2.700, 0.250, 2.400},
{ 2.800, 0.000, 2.475},
{ 2.800, -0.250, 2.475},
{ 3.525, -0.250, 2.494},
{ 3.525, 0.000, 2.494},
{ 2.900, 0.000, 2.475},
{ 2.900, -0.150, 2.475},
{ 3.450, -0.150, 2.513},
{ 3.450, 0.000, 2.513},
{ 2.800, 0.000, 2.400},
{ 2.800, -0.150, 2.400},
{ 3.200, -0.150, 2.400},
{ 3.200, 0.000, 2.400},
{ 3.525, 0.250, 2.494},
{ 2.800, 0.250, 2.475},
{ 3.450, 0.150, 2.513},
{ 2.900, 0.150, 2.475},
{ 3.200, 0.150, 2.400},
{ 2.800, 0.150, 2.400},
{ 0.000, 0.000, 3.150},
{ 0.000, -0.002, 3.150},
{ 0.002, 0.000, 3.150},
{ 0.800, 0.000, 3.150},
{ 0.800, -0.450, 3.150},
{ 0.450, -0.800, 3.150},
{ 0.000, -0.800, 3.150},
{ 0.000, 0.000, 2.850},
{ 0.200, 0.000, 2.700},
{ 0.200, -0.112, 2.700},
{ 0.112, -0.200, 2.700},
{ 0.000, -0.200, 2.700},
{-0.002, 0.000, 3.150},
{-0.450, -0.800, 3.150},
{-0.800, -0.450, 3.150},
{-0.800, 0.000, 3.150},
{-0.112, -0.200, 2.700},
{-0.200, -0.112, 2.700},
{-0.200, 0.000, 2.700},
{ 0.000, 0.002, 3.150},
{-0.800, 0.450, 3.150},
{-0.450, 0.800, 3.150},
{ 0.000, 0.800, 3.150},
{-0.200, 0.112, 2.700},
{-0.112, 0.200, 2.700},
{ 0.000, 0.200, 2.700},
{ 0.450, 0.800, 3.150},
{ 0.800, 0.450, 3.150},
{ 0.112, 0.200, 2.700},
{ 0.200, 0.112, 2.700},
{ 0.400, 0.000, 2.550},
{ 0.400, -0.224, 2.550},
{ 0.224, -0.400, 2.550},
{ 0.000, -0.400, 2.550},
{ 1.300, 0.000, 2.550},
{ 1.300, -0.728, 2.550},
{ 0.728, -1.300, 2.550},
{ 0.000, -1.300, 2.550},
{ 1.300, 0.000, 2.400},
{ 1.300, -0.728, 2.400},
{ 0.728, -1.300, 2.400},
{ 0.000, -1.300, 2.400},
{-0.224, -0.400, 2.550},
{-0.400, -0.224, 2.550},
{-0.400, 0.000, 2.550},
{-0.728, -1.300, 2.550},
{-1.300, -0.728, 2.550},
{-1.300, 0.000, 2.550},
{-0.728, -1.300, 2.400},
{-1.300, -0.728, 2.400},
{-1.300, 0.000, 2.400},
{-0.400, 0.224, 2.550},
{-0.224, 0.400, 2.550},
{ 0.000, 0.400, 2.550},
{-1.300, 0.728, 2.550},
{-0.728, 1.300, 2.550},
{ 0.000, 1.300, 2.550},
{-1.300, 0.728, 2.400},
{-0.728, 1.300, 2.400},
{ 0.000, 1.300, 2.400},
{ 0.224, 0.400, 2.550},
{ 0.400, 0.224, 2.550},
{ 0.728, 1.300, 2.550},
{ 1.300, 0.728, 2.550},
{ 0.728, 1.300, 2.400},
{ 1.300, 0.728, 2.400},
{ 0.000, 0.000, 0.000},
{ 1.500, 0.000, 0.150